/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-01-15
 * Time: 11:25
 */
public class TestBinarySearchTree {
    public static void main(String[] args) {
        int i = 19;
        Integer a = Integer.valueOf(19);
        a.equals(19);

        BinarySearchTree binarySearchTree = new BinarySearchTree();
        binarySearchTree.insert(5);
        binarySearchTree.insert(3);
        binarySearchTree.insert(7);
        binarySearchTree.insert(1);
        binarySearchTree.insert(4);
        binarySearchTree.insert(6);
        binarySearchTree.insert(8);
        binarySearchTree.insert(0);
        binarySearchTree.insert(2);
        binarySearchTree.insert(9);
        binarySearchTree.insert(10);
//                          5
//                        /   \
//                       3     7
//                      / \   / \
//                     1   4 6   8
//                    / \         \
//                   0   2         9
//                                  \
//                                   10

        binarySearchTree.inOrder(binarySearchTree.root);
        System.out.println();

        binarySearchTree.remove(4);
        binarySearchTree.inOrder(binarySearchTree.root);
        System.out.println();

        System.out.println("==================");

    }

}
